home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Other Langs / Tickle-4.0 (tcl) / library / help / tcl / signals / signal
Encoding:
Text File  |  1993-10-26  |  3.5 KB  |  67 lines  |  [TEXT/$Tcl]

  1.  
  2.  
  3.           signal action siglist ?command?
  4.                Specify the action  to  take  when  a  Unix  signal  is
  5.                received  by Extended Tcl, or a program that embeds it.
  6.                Siglist is a list of either  the  symbolic  or  numeric
  7.                Unix  signal  (the  SIG prefix is optional).  Action is
  8.                one of the following actions to be performed on receipt
  9.                of the signal.
  10.  
  11.                default - Perform system default action when signal  is
  12.                received (see signal system call documentation).
  13.  
  14.                ignore - Ignore the signal.
  15.  
  16.                error - Generate a catchable Tcl error.  It will be  as
  17.                if the command that was running returned an error.  The
  18.                error code will be in the form:
  19.                    POSIX SIG signame
  20.                For the death of child signal, signame will  always  be
  21.                SIGCHLD,  rather than SIGCLD, to allow writing portable
  22.                code.
  23.  
  24.                trap - When the signal occurs, execute command and con-
  25.                tinue execution if an error is not returned by command.
  26.                The command will be executed  in  the  global  context.
  27.                The  command will be edited before execution, replacing
  28.                occurrences of "%S" with the signal name.   Occurrences
  29.                of  "%%"  result  in a single "%".  This editing occurs
  30.                just before the trap command is evaluated. If an  error
  31.                is returned, then follow the standard Tcl error mechan-
  32.                ism.  Often command will just do an exit.
  33.  
  34.                get - Retrieve the current settings  of  the  specified
  35.                signals.   A  keyed list will be returned were the keys
  36.                are one of the specified signals and the values  are  a
  37.                list  cosisting  of the action associated with the sig-
  38.                nal, a 0 if the signal may be delivered (not block) and
  39.                a  1  if  it  is  blocked.  The  actions  maybe  one of
  40.                `default',`ignore', `error' or `trap.  If the action is
  41.                trap,  the third element is the command associated with
  42.                the action.
  43.  
  44.                block  -  Block  the  specified  signals   from   being
  45.                received. (Posix systems only).
  46.  
  47.                unblock - Allow the specified signal  to  be  received.
  48.                Pending signals will not occur. (Posix systems only).
  49.  
  50.                The signal action will remain enabled after the  speci-
  51.                fied  signal  has  occurred.   The exception to this is
  52.                SIGCHLD on systems without Posix  signals.   For  these
  53.                systems,  SIGCHLD  is  not  be automatically reenabled.
  54.                After a SIGCHLD signal is received, a call to wait must
  55.                be  performed  to retrieve the exit status of the child
  56.                process before issuing another signal SIGCHLD ...  com-
  57.                mand.   For  code  that  is to be portable between both
  58.                types of systems, use this approach.
  59.  
  60.                Signals are not processed until after the completion of
  61.                the  Tcl  command  that is executing when the signal is
  62.                received.  If an interactive Tcl shell is running, then
  63.                the  SIGINT  will  be set to error, non-interactive Tcl
  64.                sessions leave SIGINT unchanged from when  the  process
  65.                started  (normally default for foreground processes and
  66.                ignore for processes in the background).
  67.